package com.ama.controller;

import com.ama.model.User;
import com.ama.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MybatisController {
    @Autowired
    private UserService userService;

    @RequestMapping("/boot/getUserById")
    public User getUser() {
        return userService.getUserById(1);
    }

    @RequestMapping("/boot/updateUser")
    public User updateUser(){
        User user = new User();
        user.setId(1);
        user.setName("upama11");
        user.setPassword("up12311");
        userService.updateUser(user);
        return user;
    }
}